<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var weight=parseInt(prompt("输入体重"))
    var height=parseFloat(prompt("输入身高"))
    console.log(height);
    
    var pmi=parseInt(weight/(height*height))
    if(pmi<18.5){
        alert("偏瘦")
    }else if(pmi>=18.5&&pmi<20.9){
        alert("苗条")
    }else if(pmi>=20.9&&pmi<=24.9){
        alert("适中")
    }else if(pmi>24.9){
        alert("偏胖")
    }

</script>